# Contributor: Trevis Schiffer <nikolaibitinit@gmail.com>
# Maintainer: Trevis Schiffer <nikolaibitinit@gmail.com>
pkgname=solidity
pkgver=0.7.5
pkgrel=4
_commit=51b20bc0872bb9049e205d5547023cb06d1df9db
pkgdesc="The Solidity Contract-Oriented Programming Language"
url="https://github.com/ethereum/solidity"
# No support for big-endian systems and 32-bits
arch="all !s390x !x86 !armv7 !armhf !riscv64"
license="GPL-3.0-or-later"
makedepends="boost-dev cmake git"
source="$pkgname-$pkgver.tar.gz::https://github.com/ethereum/solidity/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	echo -n $_commit > commit_hash.txt
}

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBoost_USE_STATIC_LIBS=OFF \
		-DTESTS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	cd build
	# Broken tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -V
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
4fbe5e3eac0fe534f3a9eda554c2d020fe65537ebcdacea4e113cf8fcfffd6b99bcb94f2d853f9cb0b2b0195ba36b6dbc8be2ce5f7304eccd94d8bf936271f79  solidity-0.7.5.tar.gz
"
